from oasr.recognize.nart import NARTRecognizer


def build_recognizer(model_type, model, lm, args, idx2unit, output_dir):
    if 'nart' in model_type:
        return NARTRecognizer(
            model=model, lm=lm, lm_weight=args.lm_weight, beam_width=args.beam_width, nbest=args.nbest, max_len=args.max_len, idx2unit=idx2unit,
            ngpu=args.ngpu, mode=args.mode, apply_two_pass_decode=args.apply_two_pass, ar_weight=args.two_pass_weight,
            is_visual=args.is_visual, output_dir=output_dir
        )
    else:
        raise NotImplementedError
